<form class="appForm" action="<?=CONTEXT_PATH?>/admin/article/add" method="post">
	<div class="easyui-panel" data-options="border:false" >
		<input name="id" type="hidden"/>
		<table class ="appTable" border="false">
			<tr>
				<td style="width:10%;" class="label">标题:</td>
				<td  style="width:40%;" >
					<input name="title" style="width:90%;" class="easyui-textbox" type="text" data-options="required:true" />
				</td>
				<td  style="width:10%;"  class="label">作者:</td>
				<td  style="width:40%;" >
					<input name="autor" readonly style="width:90%;" value="<?=$_SESSION['user']->login_name?>" class="easyui-textbox" type="text"/>
				</td>
			</tr>
			<tr>
				<td class="label">外链:</td>
				<td>
					<input name="out_link" style="width:90%;"  class="easyui-textbox" type="text" />
				</td>
				<td class="label">来源:</td>
				<td>
					<input name="referer" style="width:90%;" value="<?=WEB_NAME?>"  class="easyui-textbox" type="text" />
				</td>
			</tr>
			<?php if(\app\common\LoginFilter::isAuth('/template/default/admin/js/ueditor/php/controller.php')){?>
			<tr>
				<td class="label">图片:</td>
				<td colspan="3">
					<input name="img" style="width:70%;" readonly class="easyui-textbox" type="text"/>
					<input id="art_upload<?=$_GET['uedit']?>" type="file"/>
				</td>
			</tr>
			<?php } ?>
			<tr>
				<td class="label">是否发布:</td>
				<td>
					<input name="status" <?=$_SESSION['user']->is_admin==0?'disabled':''?> value="1" class="easyui-switchbutton">
				</td>
				<td class="label">排序:</td>
				<td>
					<input name="orders" style="width:90%;" value="99" class="easyui-numberbox" type="text" />
				</td>
			</tr>
			<tr>
				<td class="label">seo关键字:</td>
				<td>
					<textarea style="width:90%;height:50px;"  name="seo_key" class="easyui-textbox" type="text" data-options="multiline:true" ></textarea>
				</td>
				<td class="label">seo描述:</td>
				<td>
					<textarea  style="width:90%;height:50px;" name="seo_description" class="easyui-textbox" type="text" data-options="multiline:true" ></textarea>
				</td>
			</tr>
			<tr>
				<td class="label">简述:</td>
				<td colspan="3">
					<textarea style="width:90%;height:50px;" name="summary" class="easyui-textbox" type="text" data-options="multiline:true" ></textarea>
				</td>
			</tr>
			<tr>
				<td class="label">标签:</td>
				<td colspan="3">
					<a id="label_btn_<?=$_GET['uedit']?>" icon="icon icon-add" class="easyui-linkbutton">添加</a>
				</td>
			</tr>
			<tr>
				<td class="label">正文:</td>
				<td colspan="3">
					<textarea id="editor<?=$_GET['uedit']?>" style="width:100%;height:500px;" name="detail"></textarea>
				</td>
			</tr>
		</table>
		<div class="dialog-button" style="position: relative;border:none;">
			<button type="submit" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存</button>
		</div>
	</div>
</form>

<script type="text/javascript">
if('<?=$_GET['uedit']?>'==''){
	UE.delEditor('editor<?=$_GET['uedit']?>');
	var ue = UE.getEditor('editor<?=$_GET['uedit']?>');
	var form = $("form.appForm").eq($("form.appForm").size()-1);
	form.form({
		form:form.get(0),
		success:function(jsonStr){
			$.messager.progress('close');
			var json = str2Json(jsonStr);
			if(json.msg){
				$.appTip(json.msg);
			}
			if(json.success){
				$(this.form).form("reset");
				var ue = UE.getEditor('editor<?=$_GET['uedit']?>');
				ue.execCommand("cleardoc");
			}
		}
	});
}
$.appUpload({
	id:'art_upload<?=$_GET['uedit']?>'
});
$("a#label_btn_<?=$_GET['uedit']?>").on("click",function(){
	$("<div/>").dialog({
		title:'请选择标签',
		height:400,
		href: _tpl+'/admin/label_dialog_list.tpl.php?label_id=label_btn_<?=$_GET['uedit']?>'
	});
})
</script>			